package com.cb.domain.model.order;


import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * BOrder Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 * 订单中心
 */
@Entity
@Table(name="b_order")
public class BOrder implements Serializable {

    protected Long id;
	protected String orderNo;
	protected String tradeNo;
	protected Long noPay;
	protected Long childPrintPrice;
	protected Long childFaceValue;
	protected String cabinnote;
	protected String source;
	protected String ticketMode;
	protected String payChannel;
	protected Long insuranceUnitPrice;
	protected Long xcdPrice;
	protected String backnote;
	protected Long allPrice;
	protected Long insuranceCuttingPrice;
	protected String xcd;
	protected String sjr;
	protected String contactTel;
	protected String address;
	protected String company;
	protected Long expType;
	protected String orderNumber;
	protected java.util.Date sendtime;
	protected Long viewPrice;
	protected Long price;
	protected String pnr;
	protected String cpnr;
	protected Double constructionFee;
	protected Double fuelTax;
	protected Double childFuelTax;
	protected Long status;
	protected String contact;
	protected String contactMob;
	protected String contactEmail;
	protected java.util.Date createTime;
	protected Long needPS;
	protected Long payStatus;
	protected Long lockSystemUserId;
	protected java.util.Date updateTime;
	protected Long needXC;
	protected Long needFP;
	protected Long orderType;
	protected com.cb.domain.model.system.SystemUser systemUser;
	protected com.cb.domain.model.order.Policy policy;
	protected com.cb.domain.model.user.UserAccount userAccount;
	protected Double taxStatistics;
	protected Double insuranceStatistics;
	protected Double refundFee;
	protected Long flightType;
	protected String contactCode;
	protected String ticketChannel;
	protected String changeDescription;
	protected String returnDescription;
	protected String remark;
	protected Integer returnType;

	@Column(name="returnType")
	public Integer getReturnType() {
		return returnType;
	}

	public void setReturnType(Integer returnType) {
		this.returnType = returnType;
	}

	@Column(name="remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name="changeDescription")
	public String getChangeDescription() {
		return changeDescription;
	}

	public void setChangeDescription(String changeDescription) {
		this.changeDescription = changeDescription;
	}

	@Column(name="returnDescription")
	public String getReturnDescription() {
		return returnDescription;
	}

	public void setReturnDescription(String returnDescription) {
		this.returnDescription = returnDescription;
	}

	@Column(name="ticketChannel")
	public String getTicketChannel() {
		return ticketChannel;
	}

	public void setTicketChannel(String ticketChannel) {
		this.ticketChannel = ticketChannel;
	}

	@Column(name="tradeNo")
	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	@Column(name="contactCode")
	public String getContactCode() {
		return contactCode;
	}

	public void setContactCode(String contactCode) {
		this.contactCode = contactCode;
	}

	@Column(name="flightType")
	public Long getFlightType() {
		return flightType;
	}

	public void setFlightType(Long flightType) {
		this.flightType = flightType;
	}

	@Column(name="taxStatistics")
	public Double getTaxStatistics() {
		return taxStatistics;
	}

	public void setTaxStatistics(Double taxStatistics) {
		this.taxStatistics = taxStatistics;
	}

	@Column(name="insuranceStatistics")
	public Double getInsuranceStatistics() {
		return insuranceStatistics;
	}

	public void setInsuranceStatistics(Double insuranceStatistics) {
		this.insuranceStatistics = insuranceStatistics;
	}

	@Column(name="refundFee")
	public Double getRefundFee() {
		return refundFee;
	}

	public void setRefundFee(Double refundFee) {
		this.refundFee = refundFee;
	}

	protected java.util.Set<Flight> flights = new java.util.HashSet<Flight>();
	protected java.util.Set<Passenger> passengers = new java.util.HashSet<Passenger>();

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "systemUserId", unique = false, nullable = true, insertable = true, updatable = true)
	public com.cb.domain.model.system.SystemUser getSystemUser () {
		return systemUser;
	}	
	
	public void setSystemUser (com.cb.domain.model.system.SystemUser in_systemUser) {
		this.systemUser = in_systemUser;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "policyFriendly", unique = false, nullable = true, insertable = true, updatable = true)
	public com.cb.domain.model.order.Policy getPolicy () {
		return policy;
	}	
	
	public void setPolicy (com.cb.domain.model.order.Policy in_policy) {
		this.policy = in_policy;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "userId", unique = false, nullable = true, insertable = true, updatable = true)
	public com.cb.domain.model.user.UserAccount getUserAccount () {
		return userAccount;
	}	
	
	public void setUserAccount (com.cb.domain.model.user.UserAccount in_userAccount) {
		this.userAccount = in_userAccount;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "order")
	public java.util.Set<Flight> getFlights () {
		return flights;
	}	
	
	public void setFlights (java.util.Set<Flight> in_flights) {
		this.flights = in_flights;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "bOrder")
	public java.util.Set<Passenger> getPassengers () {
		return passengers;
	}	
	
	public void setPassengers (java.util.Set<Passenger> in_passengers) {
		this.passengers = in_passengers;
	}
    

	/**
	 * 	 * @return Long
     * @hibernate.id column="id" type="java.lang.Long" generator-class="native"
	 */
	
	@Id     
    @GeneratedValue(generator="Id_Generator")
    @GenericGenerator(name="Id_Generator", strategy="com.cb.common.util.IdGenerator")
	public Long getId() {
		return this.id;
	}
	
	/**
	 * Set the id
	 */	
	public void setId(Long aValue) {
		this.id = aValue;
	}	

	/**
	 * 订单号	 * @return String
	 * @hibernate.property column="orderNo" type="java.lang.String" length="100" not-null="true" unique="false"
	 */
	
	@Column(name = "orderNo")	
	public String getOrderNo() {
		return this.orderNo;
	}
	
	/**
	 * Set the orderNo
	 * @spring.validator type="required"
	 */	
	public void setOrderNo(String aValue) {
		this.orderNo = aValue;
	}	

	/**
	 * 未支付金额	 * @return Long
	 * @hibernate.property column="noPay" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "noPay")	
	public Long getNoPay() {
		return this.noPay;
	}
	
	/**
	 * Set the noPay
	 */	
	public void setNoPay(Long aValue) {
		this.noPay = aValue;
	}	

	/**
	 * 儿童销售价	 * @return Long
	 * @hibernate.property column="childPrintPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "childPrintPrice")	
	public Long getChildPrintPrice() {
		return this.childPrintPrice;
	}
	
	/**
	 * Set the childPrintPrice
	 */	
	public void setChildPrintPrice(Long aValue) {
		this.childPrintPrice = aValue;
	}	

	/**
	 * 儿童票面价	 * @return Long
	 * @hibernate.property column="childFaceValue" type="java.lang.Long" length="19" not-null="true" unique="false"
	 */
	
	@Column(name = "childFaceValue")	
	public Long getChildFaceValue() {
		return this.childFaceValue;
	}
	
	/**
	 * Set the childFaceValue
	 * @spring.validator type="required"
	 */	
	public void setChildFaceValue(Long aValue) {
		this.childFaceValue = aValue;
	}	

	/**
	 * 舱位说明	 * @return String
	 * @hibernate.property column="cabinnote" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "cabinnote")	
	public String getCabinnote() {
		return this.cabinnote;
	}
	
	/**
	 * Set the cabinnote
	 */	
	public void setCabinnote(String aValue) {
		this.cabinnote = aValue;
	}	

	/**
	 * 订单来源	 * @return String
	 * @hibernate.property column="source" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "source")	
	public String getSource() {
		return this.source;
	}
	
	/**
	 * Set the source
	 */	
	public void setSource(String aValue) {
		this.source = aValue;
	}	

	/**
	 * 出票方式	 * @return String
	 * @hibernate.property column="ticketMode" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "ticketMode")	
	public String getTicketMode() {
		return this.ticketMode;
	}
	
	/**
	 * Set the ticketMode
	 */	
	public void setTicketMode(String aValue) {
		this.ticketMode = aValue;
	}	

	/**
	 * 支付渠道	 * @return String
	 * @hibernate.property column="payChannel" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "payChannel")	
	public String getPayChannel() {
		return this.payChannel;
	}
	
	/**
	 * Set the payChannel
	 */	
	public void setPayChannel(String aValue) {
		this.payChannel = aValue;
	}	

	/**
	 * 保险单价	 * @return Long
	 * @hibernate.property column="insuranceUnitPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "insuranceUnitPrice")	
	public Long getInsuranceUnitPrice() {
		return this.insuranceUnitPrice;
	}
	
	/**
	 * Set the insuranceUnitPrice
	 */	
	public void setInsuranceUnitPrice(Long aValue) {
		this.insuranceUnitPrice = aValue;
	}	

	/**
	 * 快递费	 * @return Long
	 * @hibernate.property column="xcdPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "xcdPrice")	
	public Long getXcdPrice() {
		if(this.xcdPrice==null){
			return 0l;
		}
		return this.xcdPrice;
	}
	
	/**
	 * Set the xcdPrice
	 */	
	public void setXcdPrice(Long aValue) {
		this.xcdPrice = aValue;
	}	

	/**
	 * 退改签说明	 * @return String
	 * @hibernate.property column="backnote" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "backnote")	
	public String getBacknote() {
		return this.backnote;
	}
	
	/**
	 * Set the backnote
	 */	
	public void setBacknote(String aValue) {
		this.backnote = aValue;
	}	

	/**
	 * 订单金额	 * @return Long
	 * @hibernate.property column="allPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "allPrice")	
	public Long getAllPrice() {
		return this.allPrice;
	}
	
	/**
	 * Set the allPrice
	 */	
	public void setAllPrice(Long aValue) {
		this.allPrice = aValue;
	}	

	/**
	 * 保险让利价	 * @return Long
	 * @hibernate.property column="insuranceCuttingPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "insuranceCuttingPrice")	
	public Long getInsuranceCuttingPrice() {
		return this.insuranceCuttingPrice;
	}
	
	/**
	 * Set the insuranceCuttingPrice
	 */	
	public void setInsuranceCuttingPrice(Long aValue) {
		this.insuranceCuttingPrice = aValue;
	}	

	/**
	 * 快递内容	 * @return String
	 * @hibernate.property column="xcd" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "xcd")	
	public String getXcd() {
		return this.xcd;
	}
	
	/**
	 * Set the xcd
	 */	
	public void setXcd(String aValue) {
		this.xcd = aValue;
	}	

	/**
	 * 收件人姓名	 * @return String
	 * @hibernate.property column="sjr" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "sjr")	
	public String getSjr() {
		return this.sjr;
	}
	
	/**
	 * Set the sjr
	 */	
	public void setSjr(String aValue) {
		this.sjr = aValue;
	}	

	/**
	 * 收件人电话	 * @return String
	 * @hibernate.property column="contactTel" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "contactTel")	
	public String getContactTel() {
		return this.contactTel;
	}
	
	/**
	 * Set the contactTel
	 */	
	public void setContactTel(String aValue) {
		this.contactTel = aValue;
	}	

	/**
	 * 收件人地址	 * @return String
	 * @hibernate.property column="address" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "address")	
	public String getAddress() {
		return this.address;
	}
	
	/**
	 * Set the address
	 */	
	public void setAddress(String aValue) {
		this.address = aValue;
	}	

	/**
	 * 快递公司	 * @return String
	 * @hibernate.property column="company" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "company")	
	public String getCompany() {
		return this.company;
	}
	
	/**
	 * Set the company
	 */	
	public void setCompany(String aValue) {
		this.company = aValue;
	}	

	/**
	 * 递送方式	 * @return Long
	 * @hibernate.property column="expType" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "expType")	
	public Long getExpType() {
		return this.expType;
	}
	
	/**
	 * Set the expType
	 */	
	public void setExpType(Long aValue) {
		this.expType = aValue;
	}	

	/**
	 * 快递号	 * @return String
	 * @hibernate.property column="orderNumber" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "orderNumber")	
	public String getOrderNumber() {
		return this.orderNumber;
	}
	
	/**
	 * Set the orderNumber
	 */	
	public void setOrderNumber(String aValue) {
		this.orderNumber = aValue;
	}	

	/**
	 * 投递日期	 * @return java.util.Date
	 * @hibernate.property column="sendtime" type="java.util.Date" length="10" not-null="false" unique="false"
	 */
	
	@Column(name = "sendtime")	
	public java.util.Date getSendtime() {
		return this.sendtime;
	}
	
	/**
	 * Set the sendtime
	 */	
	public void setSendtime(java.util.Date aValue) {
		this.sendtime = aValue;
	}	

	/**
	 * 票面价	 * @return Long
	 * @hibernate.property column="viewPrice" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "viewPrice")	
	public Long getViewPrice() {
		return this.viewPrice;
	}
	
	/**
	 * Set the viewPrice
	 */	
	public void setViewPrice(Long aValue) {
		this.viewPrice = aValue;
	}	

	/**
	 * 销售价	 * @return Long
	 * @hibernate.property column="price" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "price")	
	public Long getPrice() {
		return this.price;
	}
	
	/**
	 * Set the price
	 */	
	public void setPrice(Long aValue) {
		this.price = aValue;
	}	

	/**
	 * PNR	 * @return String
	 * @hibernate.property column="pnr" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "pnr")	
	public String getPnr() {
		return this.pnr;
	}
	
	/**
	 * Set the pnr
	 */	
	public void setPnr(String aValue) {
		this.pnr = aValue;
	}	

	/**
	 * 儿童PNR	 * @return String
	 * @hibernate.property column="cpnr" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "cpnr")	
	public String getCpnr() {
		return this.cpnr;
	}
	
	/**
	 * Set the cpnr
	 */	
	public void setCpnr(String aValue) {
		this.cpnr = aValue;
	}	

	/**
	 * constructionFee	 * @return Double
	 * @hibernate.property column="constructionFee" type="java.lang.Double" length="22" not-null="false" unique="false"
	 */
	
	@Column(name = "constructionFee")	
	public Double getConstructionFee() {
		return this.constructionFee;
	}
	
	/**
	 * Set the constructionFee
	 */	
	public void setConstructionFee(Double aValue) {
		this.constructionFee = aValue;
	}	

	/**
	 * 	 * @return Double
	 * @hibernate.property column="fuelTax" type="java.lang.Double" length="22" not-null="false" unique="false"
	 */
	
	@Column(name = "fuelTax")	
	public Double getFuelTax() {
		return this.fuelTax;
	}
	
	/**
	 * Set the fuelTax
	 */	
	public void setFuelTax(Double aValue) {
		this.fuelTax = aValue;
	}	

	/**
	 * 	 * @return Double
	 * @hibernate.property column="childFuelTax" type="java.lang.Double" length="22" not-null="false" unique="false"
	 */
	
	@Column(name = "childFuelTax")	
	public Double getChildFuelTax() {
		return this.childFuelTax;
	}
	
	/**
	 * Set the childFuelTax
	 */	
	public void setChildFuelTax(Double aValue) {
		this.childFuelTax = aValue;
	}	

	/**
	 * 订单状态	 * @return Long
	 * @hibernate.property column="status" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "status")	
	public Long getStatus() {
		return this.status;
	}
	
	/**
	 * Set the status
	 */	
	public void setStatus(Long aValue) {
		this.status = aValue;
	}	

	/**
	 * 联系人姓名	 * @return String
	 * @hibernate.property column="contact" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "contact")	
	public String getContact() {
		return this.contact;
	}
	
	/**
	 * Set the contact
	 */	
	public void setContact(String aValue) {
		this.contact = aValue;
	}	

	/**
	 * 联系人电话	 * @return String
	 * @hibernate.property column="contactMob" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "contactMob")	
	public String getContactMob() {
		return this.contactMob;
	}
	
	/**
	 * Set the contactMob
	 */	
	public void setContactMob(String aValue) {
		this.contactMob = aValue;
	}	

	/**
	 * 联系人邮箱	 * @return String
	 * @hibernate.property column="contactEmail" type="java.lang.String" length="100" not-null="false" unique="false"
	 */
	
	@Column(name = "contactEmail")	
	public String getContactEmail() {
		return this.contactEmail;
	}
	
	/**
	 * Set the contactEmail
	 */	
	public void setContactEmail(String aValue) {
		this.contactEmail = aValue;
	}	

	/**
	 * 订单创建时间	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="10" not-null="false" unique="false"
	 */
	
	@Column(name = "createTime")	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	

	/**
	 * 是否需要配送	 * @return Long
	 * @hibernate.property column="needPS" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "needPS")	
	public Long getNeedPS() {
		return this.needPS;
	}
	
	/**
	 * Set the needPS
	 */	
	public void setNeedPS(Long aValue) {
		this.needPS = aValue;
	}	

	/**
	 * 	 * @return Long
	 * @hibernate.property column="payStatus" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "payStatus")	
	public Long getPayStatus() {
		return this.payStatus;
	}
	
	/**
	 * Set the payStatus
	 */	
	public void setPayStatus(Long aValue) {
		this.payStatus = aValue;
	}	



	/**
	 * 锁定人	 * @return Long
	 * @hibernate.property column="lockSystemUserId" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "lockSystemUserId")	
	public Long getLockSystemUserId() {
		return this.lockSystemUserId;
	}
	
	/**
	 * Set the lockSystemUserId
	 */	
	public void setLockSystemUserId(Long aValue) {
		this.lockSystemUserId = aValue;
	}	

	/**
	 * 更新时间	 * @return java.util.Date
	 * @hibernate.property column="updateTime" type="java.util.Date" length="10" not-null="false" unique="false"
	 */
	
	@Column(name = "updateTime")	
	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}
	
	/**
	 * Set the updateTime
	 */	
	public void setUpdateTime(java.util.Date aValue) {
		this.updateTime = aValue;
	}	

	/**
	 * 是否需要行程单	 * @return Long
	 * @hibernate.property column="needXC" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "needXC")	
	public Long getNeedXC() {
		return this.needXC;
	}
	
	/**
	 * Set the needXC
	 */	
	public void setNeedXC(Long aValue) {
		this.needXC = aValue;
	}	

	/**
	 * 是否需要保险发票	 * @return Long
	 * @hibernate.property column="needFP" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "needFP")	
	public Long getNeedFP() {
		return this.needFP;
	}
	
	/**
	 * Set the needFP
	 */	
	public void setNeedFP(Long aValue) {
		this.needFP = aValue;
	}	

	/**
	 * 订单类型	 * @return Long
	 * @hibernate.property column="orderType" type="java.lang.Long" length="19" not-null="false" unique="false"
	 */
	
	@Column(name = "orderType")	
	public Long getOrderType() {
		return this.orderType;
	}
	
	/**
	 * Set the orderType
	 */	
	public void setOrderType(Long aValue) {
		this.orderType = aValue;
	}	

}